Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I mentioned in class that 13! 1932053504 is wrong for data type int (caused by overflow) Below is my result of running smallfact2.java (posted at

image text in transcribed

I mentioned in class that 13! 1932053504 is wrong for data type int (caused by overflow) Below is my result of running smallfact2.java (posted at the end of module 1) for short, int, long, float, and double 13! in short is -13312 13! is 1932053504 13! in long is 6227020800 13! in float is 6.2270208E9 13! in double is 6.2270208E9 (a) (3%) Is the result for int (=1932053504) right? Why? 1 (b) (10%) why the output for 13! for int data type is calculated to be 1932053504? Show how you can calculate to get this number. (c) (5%) We see that 13! for short, int, and long are all different. Which one ifs right? (or all three are wrong?) (or all three though looking different, are all correct) (d) (10%) We see that 13! Calculated for long (6227020800) and for float and double (6.2270208E9) look a little bit different. Does this mean only the result for long is correct (and result for float and double are wrong), or only the result for float and double are right and the result for long is wrong, or all 3 results are right, or all 3 results are wrong? Explain! (e) (7%) Explain why for short, 13! is calculated to be -13312

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems 6th Asian Conference Aciids 2014 Bangkok Thailand April 7 9 2014 Proceedings Part I 9 2014 Proceedings Part 1 Lnai 8397

Authors: Ngoc-Thanh Nguyen ,Boonwat Attachoo ,Bogdan Trawinski ,Kulwadee Somboonviwat

2014th Edition

3319054759, 978-3319054759

More Books

Students also viewed these Databases questions

Question

1. Define mass and mediated communication

Answered: 1 week ago

Question

13. You always should try to make a good first impression.

Answered: 1 week ago