🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.ghostscript.bug
Article #140

Retraction re 'div'

#140
From: L. Peter Deutsch
Date: Sat, 25 Jul 1992 19:41
26 lines
1594 bytes
A recent poster claimed that Ghostscript's 'div' operator incorrectly
produced an integer result when dividing two integers with no
remainder, e.g.
	40 10 div ==
prints
	4

The poster was wrong.  The result of 'div' is always a real.
However, Ghostscript, unlike some other PostScript language
interpreters, may print a real number with no fractional part without
the decimal point.

I suppose it would be better if Ghostscript always printed reals with
a decimal point, since that would guarantee that printing out a real
and reading it back in again would produce a real rather than an
integer, but since all operators in the PostScript language that
accept reals also accept integers, printing reals without a decimal
point cannot cause trouble in this respect.

Bottom line: I'm not going to bother changing the print routine (I
just use sprintf with a %g format) unless someone can show me a real
file on which this difference causes the wrong thing to happen.

L. Peter Deutsch :: Aladdin Enterprises :: P.O. box 60264, Palo Alto, CA 94306
ghost@aladdin.com, ...decwrl!aladdin!ghost ; 415-322-0103 voice ; no fax yet
	    "Implementation is the sincerest form of flattery."
Technical Details
Message-ID: <9207251241.0.UUL1.3#5127@aladdin.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!aladdin.COM!ghost

Show Full Headers
Complete Article Headers
Newsgroups: gnu.ghostscript.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!aladdin.COM!ghost
From: ghost@aladdin.COM (L. Peter Deutsch)
Subject: Retraction re 'div'
Message-ID: <9207251241.0.UUL1.3#5127@aladdin.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sat, 25 Jul 1992 19:41:06 GMT
Approved: bug-ghostscript@prep.ai.mit.edu
Lines: 28