F# random class throws BadImageFormatException when calling .NextDouble() -
i have made small application book f#, when call rand.nextdouble() method throws badimageformatexception, @ first glance looks it's images have no idea i'm supposed here.
i'm using vs community 2013 using visual f# 2013. have 64 bit windows 7
i know it's nextdouble method that's problem through trying seperate let
let create_field num_asteroids = let lerp (x: float<'u>) (y:float<'u>) (a:float) = x*a+y*(1.0-a) let rand = random() [for =1 num_asteroids let m = (lerp earth_mass moon_mass (rand.nextdouble()))* 1.0e-4 let x = lerp 0.0<m> field_size (rand.nextdouble()) let y = lerp 0.0<m> field_size (rand.nextdouble()) let vx = max_velocity*(rand.nextdouble()*2.0-1.0)*0.1 let vy = max_velocity*(rand.nextdouble()*2.0-1.0)*0.1 yield { position = { x = x; y = y } velocity = { x = vx; y = vy } mass = m name = "a" } ]
this errorcode:
system.badimageformatexception unhandled message: unhandled exception of type 'system.badimageformatexception' occurred in asteroid_field_1.exe additional information: attempt made load program incorrect format. (exception hresult: 0x8007000b)
msdn tells me might have dll file not being loaded in correct format, don't know start.
this full code
i tried in fsi.exe , works there fine
i fixed issue checking "optimize code" in properties of project in visual studio. got fix fellow student.
Comments
Post a Comment