python3 Math bug: In accordance with IEEE_754-1985, math.sqrt(-1.25) should return NaN, and print function should be able to indicate it.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python3-defaults (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
python3 Math bug: In accordance with IEEE_754-1985, math.sqrt(-1.25) should return NaN, and print function should be able to indicate it.
Demo code:
import math
c = math.sqrt(-1.25)
print(c)
When run produces:
Traceback (most recent call last):
File "./float-test.py", line 4, in <module>
c = math.sqrt(-1.25)
ValueError: math domain error
Should produce:
NaN
OR:
NOT A NUMBER
For more information, see https:/
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: python3 3.8.2-0ubuntu2
ProcVersionSign
Uname: Linux 5.4.0-42-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.6
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: KDE
Date: Sat Aug 15 21:30:13 2020
InstallationDate: Installed on 2020-04-26 (112 days ago)
InstallationMedia: Kubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: python3-defaults
UpgradeStatus: No upgrade log present (probably fresh install)