Here is another one

Nick Hi,

On 29 Oct 2008, at 18:31, Nick wrote:

Thanks to everyone for looking into this. The problem is due to a very obscure byte swapping problem when running on Intel. For example, swapping the number 910.9999 then swapping it back produces 911.9999 (i.e., off by one).

Apparently Intaglio’s method of swapping floating point numbers is incorrect in very rare circumstances. I’ll figure it out and post a fix.

When I first saw this email I had no idea of why one would want to swap bytes, and especially why one might want to do this with floating point numbers. So I googled

“swapping floating point numbers”

and think I now understand.

Then I remembered that I had been quite technical in one of my previous postings so I thought I’d share my understanding.

It’s been years since I’ve had even a tiny look at machine level numeric representations so I needed to check that floating point numbers are still held in mantissa/exponent format.
e.g. 100.605 = 0.100605 x 1000 and 1000 is 10 cubed, that is 10**3.
In this case 0.100605 is the mantissa and 3 the exponent

e.g. see this floating point number tutorial
http://www.cs.utah.edu/~zachary/isp/applets/FP/FP.html

this IEEE standard
http://steve.hollasch.net/cgindex/coding/ieeefloat.html

And the para headed “inexactness” three paragraphs down this page is also interesting but I don’t think pertinent to the present case.
http://www.lahey.com/float.htm

The top of the google results for “swapping floating point numbers”
http://davyd.livejournal.com/261616.html

said this interesting thing

Say you’ve got a buffer full of big-endian floats. They might have come from a file or the network. You’d really like them in your system endian so that you can do something with them.

What this quote reveals is the existence of a problem when moving numbers between computers.

“endian” refers to ways of storing numbers in a computer.
http://en.wikipedia.org/wiki/Endianness
http://www.webopedia.com/TERM/B/big_endian.html

If data is being moved between computers, e.g. from a mac to a pc or vice versa it is possible that there will be a need to translate the numbers from big-endian to little-endian or vice-versa.

However according to the mac cocoa documentation the problem can also occur when moving numbers about the same machine and especially now that apple is moving from a 32 bit to 64 bit representation on its Intel machines.

http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Tasks/ByteSwapping.html#//apple_ref/doc/uid/20001155-101132-TPXREF111

Byte Swapping Floating-Point Values

Even on a single platform there can be many different representations for floating-point values. Unless you are very careful, attempting to pass floating-point values across platform boundaries causes no end of headaches. To help you work with floating-point numbers, Core Foundation defines a set of functions and two special data types in addition to the integer-swapping functions. These functions allow you to encode 32-and 64-bit floating-point values in such a way that they can later be decoded and byte swapped if necessary.

Hope this was of interest

Nick, good luck figuring out the solution

all the best

Julius

http://juliuspaintings.co.uk

I’ve posted a test version of 3.0.2a2 with a fix for this Intel file reading problem. It can be downloaded at:

http://www.purgatorydesign.com/Intaglio/Prerelease


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Nick
Bravo.
Tested it on Cranky_UG_test and worked perfectly.
Mac pro os 10.5.5.
all the best
Julius
On 31 Oct 2008, at 20:03, Nick wrote:

I’ve posted a test version of 3.0.2a2 with a fix for this Intel file
reading problem. It can be downloaded at:

http://www.purgatorydesign.com/Intaglio/Prerelease


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Nick,

All my test files worked perfectly, thanks very much for sorting this out quickly.

I can sleep more peacefully at night knowing that I won’t have to switch to Illustrator!

Max


Intaglio mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options