develooper Front page | perl.perl6.internals | Postings from October 2002

Re: C# and Parrot

Thread Previous | Thread Next
Rhys Weatherley
October 20, 2002 15:47
Re: C# and Parrot
Message ID:
"Bryan C. Warnock" wrote:

> Interesting read.  Dan skimmed over this, but what do .NET (and JVM) doe
> for floating point numbers?

The CLI has three floating point types, of which 2 are visible
to C# and a third is used by the engine.  These are "float32",
"float64", and "native float".  The first two have specific
sizes, and are expected to be IEEE compatible.

The third is the native floating point representation for the
underlying machine, which is assumed to have precision greater
than or equal to float64.  The actual size is unspecified by
the standard, and it is OK to set "native float == float64".

Floating point operations are always performed in "native float",
and then down-graded to float32 or float64 prior to being stored
in a local or object field.

The long and the short of it is that Parrot's FLOATVAL is good
enough for C#'s purposes, with the minor requirement of a
"double -> float" conversion opcode.  Which is essentially a
"truncate and then re-extend to FLOATVAL", similar to the
"int -> short" and "int -> byte" cases.



Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About