01-04-2010
Quote:
Originally Posted by
limmer
Can anybody tell me why any literal constant real numbers are double by default in C?
It's safer to assume high precision than low precision. C will freely downconvert to float when you actually ask it to, so this behavior usually doesn't cause problems.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
How we can handle decimals in (Float) in UNIX.
a=73
b=5
c=`expr a / b`
i am getting 14 but i need full 14.6 .
Can any one help me pls? (1 Reply)
Discussion started by: subin_bala
1 Replies
2. Shell Programming and Scripting
I need to get 15% of the variable exer1 to be added to other exercises
so far, i've got
exer1=$1
aver=`expr $exer \* .15`
but i keep getting an error that an integer value was expected. Is there anyway around this? (1 Reply)
Discussion started by: kdyzsa
1 Replies
3. Shell Programming and Scripting
Hi,
I am trying to find if there is a way to convert regular decimal values to Paced decimal values. I tried to find a c program but I could get a Packed converted to regular decimal not the other way round.
If not unix please let me know if any other progrimming language I can use to do... (2 Replies)
Discussion started by: mgirinath
2 Replies
4. Shell Programming and Scripting
Hello,
I want to run a loop with non-integer values (which I know I can't) so I've created a loop of integers and divided it by 10. However, these values are always rounded down to 1 significant figure. How do I get the script to keep and use the decimal value?
My script is as follows
#... (1 Reply)
Discussion started by: DFr0st
1 Replies
5. UNIX for Dummies Questions & Answers
Hello...
I am new to unix and I am wondering if in a C-shell script , Are we supposed to use only whole numbers........ for example..if a program needs to calculate the average of some numbers........
@ avg = (($1 +$2 + $3)/3)) is returning a whole number.........How can a decimal be achieved... (1 Reply)
Discussion started by: ravindra22
1 Replies
6. AIX
Our Aix Unix has one issue.
If I type xedit &
after 30 minutes, xedit auto shut down.
If I type xedit
xedit will run forward.
I feel this & doesn't perform as it should be.
When I use &, system consider this process as idle.
How to fix this issue?
Does this mean unix env... (12 Replies)
Discussion started by: david_hu_66
12 Replies
7. Shell Programming and Scripting
I have noticed a few posts asking questions about c shell scripting these past few days. This a good read for those that currently or are thinking about writing a csh script:
Csh Programming Considered Harmful (9 Replies)
Discussion started by: ilikecows
9 Replies
8. Programming
Hi friends,
I hope everyone is doing well and fine. I have always been hearing that C/C++ are relatively low-level as compared to Java/C# etc. Could you please tell me some low-level qualities of C/C++? And I think disk deframenters are written in C/C++, please correct me if I am wrong. And please... (5 Replies)
Discussion started by: gabam
5 Replies
9. Shell Programming and Scripting
Ive a problem that I'm reaching out for help.
Ive written (With bits and pieces) of script that is not running as expected or is having an issue causing processes to spiral out of control.
The script does this:
Unloads a UV database server
Tars up a few folders
Transfers the file to... (11 Replies)
Discussion started by: coastdweller
11 Replies
10. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A common problem arising in games and simulations is to generate a random arrangements of integers from 1 to N.... (5 Replies)
Discussion started by: lamentofking
5 Replies