Advanced search
Log In | New Account   
Home My Page Project Tree Code Snippets Project Openings Batteries : Revised Standard Library
Summary Activity Forums Tracker Lists Tasks Docs News Files

Bugs: Browse | Download .csv

[#336] extNum.of_float does not work

Date:
2009-10-22 21:38
Priority:
3
State:
Open
Submitted by:
Assigned to:
Nobody (None)
Summary:
extNum.of_float does not work

Detailed description
# Num.of_float 0.1;;
- : Batteries.Num.num = <num 1/1000>

Because of_float (batteries/src/core/extlib/extNum.ml) make some wrong assumption about printf behavior :

let s = Printf.sprintf "%f" 0.1 -> expect "0.1" but get "0.100000"

Well, the Num.num_of_string shipped with ocaml fails as well on decimal numbers... A poor man solution would be to strip
trailing zeros...

Followup

No Followups Have Been Posted

Related Tasks:

No Related Tasks

Attached Files:

No Files Currently Attached

Changes:

No Changes Have Been Made to This Item


Powered By GForge Collaborative Development Environment