[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Implicit casting from double to float

Subject: Re: Implicit casting from double to float
From: "Mukul Gandhi" <gandhi.mukul@xxxxxxxxx>
Date: Wed, 7 Jan 2009 17:35:01 +0530
Re:  Implicit casting from double to float
This could be a more accurate example for the feature I described,

<xsl:variable name="num" select="xs:double('1e4')" as="xs:float" />
<xsl:value-of select="$num" />

This runs fine with Saxon 9.x.

On Wed, Jan 7, 2009 at 3:55 PM, Mukul Gandhi <gandhi.mukul@xxxxxxxxx> wrote:
> On Wed, Jan 7, 2009 at 3:28 PM, Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:
>> I guess it's more like:
>>
>> Double d = 1e4;
>> Float f = d.floatValue();
>
> This is a Java syntax for extracting float contents (perhaps, with
> loss of information) from a double value, and assigning to a float
> variable.
>
> My point was that, float = double assignment gives a compilation error
> with Java.
>
> But a
> float = double   assignment works with XSLT 2.0 without giving any
> warning or a error.
>
> It seems to me, Java has a stricter static typing rules than XSLT 2.0.



-- 
Regards,
Mukul Gandhi

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.