There are a few issues at play here. As for the original warning, "float" in an expression now means the function (but can be resolved otherwise for transitional compatibility with prior versions of F#).

"Float" is a name of a module in the powerpack, it exists for OCaml-compatibility and is not what you want here.

Also, the F# type named "float" corresponds to the .Net type System.Double.

So you want System.Double.MaxValue.

In VS, hover over each occurence of "Float" or "float" in this code

1
2
3
4
let addf = Float.add 
let x : float = 4.0
let y = float 10
let max = System.Double.MaxValue

and read the tooltips. The hover tooltips are very useful for understanding F# code.

By on 11/1/2008 1:11 PM ()

OK, I understand now. It's still confusing, though, having the naming conflicts between float, Float, double and Double. To me it seems like a rather unfortunate choice of names.

Just from a minimum confusion standpoint, I think it will be clearer just to get in the habit of using double instead of float in my future code. Does that sound reasonable?

By on 11/1/2008 2:00 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper