From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: Xl.tags.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 01 Oct 2014 20:47:46 -0500 From: Dennis Lee Bieber Newsgroups: comp.lang.ada Subject: Re: casting types Date: Wed, 01 Oct 2014 21:47:54 -0400 Organization: IISS Elusive Unicorn Message-ID: <17bp2a16ha7bgtamuvboqhvhlhdv17tp9r@4ax.com> References: <75969a22-d7f7-4517-9d10-6224beb3318c@googlegroups.com> <53743e95-0aa1-4c96-a97c-842232a58df1@googlegroups.com> X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 108.79.217.224 X-Trace: sv3-E2iUVZXPMxfAmIklzzilNDZyg5+gYbSPxfuM5GG9+8dboPG5PAfqW8XPgJuTneydZAdeMfxlVezt+IV!AG6oA0YeuLVEfWQz4r9B2CfxM7wLUuVh9ygL6DKw8Ej8qLdRwOlKp/nuEpv+BcPCc366j/dw6JWc!uru/3Qzej76vytOCibhfiDX8hFtF X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2553 Xref: number.nntp.giganews.com comp.lang.ada:189293 Date: 2014-10-01T21:47:54-04:00 List-Id: On Wed, 01 Oct 2014 19:38:22 +0200, Dirk Heinrichs declaimed the following: {responding to Stribor40} >Stribor40 wrote: > >> i would like to represent all numbers in interval [0, 1] > >Well, according to what I've learned in mathematics, you can't. Neither in >real life, nor in any programming language. You need to define some >constraint, like number of digits after the decimal point. > And on most machines these days -- you can expect the hardware to support single precision (32-bit) with ~7 significant digits, double precision (64-bit) with ~15 significant digits... And only within the floating point processor, maybe IEEE 80-bit (downconverted when the final result is returned to the user). Note that "significant digits" does not take into account the decimal point... 12300000.0, 1.23, 0.00000123 all have 3 significant digits if they are /floating point/ values (they are all 1.23E) Fixed point types are closer to integers with an implied decimal point. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/