cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Handling log10:SING error
Handling log10:SING error
Aug 9, 2010 at 7:19am
Aug 9, 2010 at 7:19am UTC
khaledun
(1)
I'm the beginner in c and c++ programming.when i want to calculate log10(0.0) then the program's output shows log10:SING error. i want to handle this error myself.how can i handle this?
Aug 9, 2010 at 11:45am
Aug 9, 2010 at 11:45am UTC
hamsterman
(4538)
Try this
1
2
3
4
5
6
7
float
l = log10(.0);
if
(errno == 0) std::cout << l;
else
{ std::cout <<
"Fail!"
; errno = 0; }
Topic archived. No new replies allowed.