Skip to content

Storable.Mutable.set operation for Vector Double does not work correctly on ghcjs #410

@dfordivam

Description

@dfordivam

With ghcjs the below code results in output [1.0,5.299808824e-315]

import qualified Data.Vector.Storable as S
import qualified Data.Vector.Storable.Mutable as SM

vecSet = do
  v <- SM.new 2
  SM.set v (1.0 :: Double)
  print =<< S.freeze v

The problematic code is here, this causes the use of primitive Word64 operations which dont work for Double as their underlying representation is different.

8 -> storableSetAsPrim n fp x (undefined :: Word64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions