W3C home > Mailing lists > Public > www-svg@w3.org > December 2005

Re: SVG12: conversion to float vs NaN

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Tue, 27 Dec 2005 23:00:59 +0100
To: Nandini Ramani <Nandini.Ramani@Sun.COM>
Cc: www-svg@w3.org
Message-ID: <ta83r1tujhi9vahgbk8pne287a9bv906ii@hive.bjoern.hoehrmann.de>

* Nandini Ramani wrote:
>    Thank you for your comments regarding conversion to float vs NaN [1].
>As per the IEEE definition, NaN is returned as a result of an arithmetic
>like 0/0. It is not appropriate to use it for conversions. So, in the
>case of getFloatTrait, we have a consistent approach to throw an
>exception when it is called for a trait that cannot be converted to a
>float type.

Okay, I shall rephrase my issue then: the current draft does not seem to
specify when a trait value can be converted to a "float" and does seem
to specify an algorithm to be used for this conversion. A naïve viewer
implementation might keep such values internally as strings and use some
string to number conversion facilities provided by the platform to make
such a conversion and might fail to check for errors; a possible result
of this are viewers that return special values like NaN to unexpecting
DOM applications; the draft should work against naïve implementations by
clearly defining this.
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Tuesday, 27 December 2005 22:01:35 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:05 UTC