🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #52164

niedokładność biginta

#52164
From: Maciej Misiak
Date: Wed, 19 Jan 2011 21:43
23 lines
1404 bytes
Help.

#!perl -l

use bigint;

($x,$y)=split/ /, "26315789473684210 5";
($l,$m)=($y.$x,$x.$y);
$xx=$l/$m;
print$l,' ', $m,' ',$xx, ' ', $xx*$m, ' ', $xx*$m-$l;
die if $xx*$m!=$l;


Ja mam w wyniku die, choć nie powinienem:
526315789473684210 263157894736842105 2 5.26315789473684e+017 64
Died at p168test.pl line 9.

Win XP, perl 5.10
Czy to jest kwestia starego softu, czy też ja czegoś nie doczytałem o 
precyzjach? Większe liczby liczone są dobrze o dziwo :(

-- 
grizzley
Technical Details
Message-ID: <ih7lun$ctt$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!.POSTED!not-for-mail
From: Maciej Misiak <grizzley@poczta.onet.pl>
Newsgroups: pl.comp.lang.perl
Subject: niedokładność biginta
Date: Wed, 19 Jan 2011 22:43:41 +0100
Organization: http://onet.pl
Lines: 23
Message-ID: <ih7lun$ctt$1@news.onet.pl>
NNTP-Posting-Host: ip-62-69-199-251.globalconnect.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1295473431 13245 62.69.199.251 (19 Jan 2011 21:43:51 GMT)
X-Complaints-To: niusy@onet.pl
NNTP-Posting-Date: Wed, 19 Jan 2011 21:43:51 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 ThunderBrowse/3.3.4
X-Antivirus: avast! (VPS 110119-0, 2011-01-19), Outbound message
X-Antivirus-Status: Clean
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit