|
[Sponsors] |
August 25, 2011, 10:35 |
Scalar precision: float vs. double
|
#1 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi
I use scalars to solve a (simple closed form) quadratic equation. Nevertheless, they always give a 6 digits precision (a float). I tried to declare the scalars as doubleScalar instead of just scalar. However, the result is still in 6 digits. I made sure that the solution can be more precise http://www.mathsisfun.com/quadratic-...on-solver.html |
|
August 25, 2011, 10:51 |
|
#2 |
Senior Member
Felix L.
Join Date: Feb 2010
Location: Hamburg
Posts: 165
Rep Power: 18 |
This is probably an output related issue.
How are you printing out your results? Greetings, Felix |
|
August 25, 2011, 11:24 |
|
#4 | |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Thanks for the tip. I guess it is an output issue. So using "cout" one can use:
Quote:
Vielen Dank nochmal |
||
August 25, 2011, 12:09 |
|
#5 |
Senior Member
David Gaden
Join Date: Apr 2009
Location: Winnipeg, Canada
Posts: 437
Rep Power: 22 |
There's a couple of precision options in the controlDict. One is for the time directory name, and the other is for the output. Can't remember what they are off-hand, but they should be easy to find.
|
|
Tags |
double, float, scalar |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Continuing User Defined Real Gas Model issues | aeroman | FLUENT | 6 | April 8, 2016 04:34 |
Parallel User Defined Real Gas Model | aeroman | FLUENT | 4 | July 1, 2015 07:09 |
Missing math.h header | Travis | FLUENT | 4 | January 15, 2009 12:48 |
what's wrong about my code for 2d burgers equation | morxio | Main CFD Forum | 3 | April 27, 2007 11:38 |
REAL GAS UDF | brian | FLUENT | 6 | September 11, 2006 09:23 |