Discussion:
[ast-developers] How to configure ksh93 to use double instead of long double as the default type
lijo george
2015-09-13 22:13:12 UTC
Permalink
Could someone let me know if it is possible at all to configure ksh93 to
use
only double precision instead of long double for arithmetic.

I've tried removing it from the libast/features/common file as given below

--- INIT.2011-02-08.old/src/lib/libast/features/common 2015-06-17
13:46:27.643760200 -0700
+++ INIT.2011-02-08/src/lib/libast/features/common 2015-06-17
13:49:27.771639200 -0700
@@ -1,7 +1,7 @@
iff AST_COMMON
hdr pthread,stdarg,stddef,stdint,inttypes,types,unistd
sys types
-typ long.double,size_t,ssize_t
+typ size_t,ssize_t
typ __va_list stdio.h

mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h

But this is causing lots of failures in the the math and arith test suites.
So I guess this might not be the right way to do this.

If someone has any pointers on this, please let me know.

Thanks,
Lijo
Rüdiger Schütz
2015-09-14 09:08:48 UTC
Permalink
The C language, not the shell, defines that floating arithmetic has to
be done in double precision.

RÃŒdiger SchÃŒtz
Enzianstraße 32
D-85098 Großmehring
Tel.: +49 8407 930 257
Mobil: +49 178 811 8257
Email: ***@consx.de



------ Originalnachricht ------
Von: "lijo george" <***@gmail.com>
An: ast-***@lists.research.att.com
Gesendet: 14.09.2015 00:13:12
Betreff: [ast-developers] How to configure ksh93 to use double instead
of long double as the default type
Post by lijo george
Could someone let me know if it is possible at all to configure ksh93
to use
only double precision instead of long double for arithmetic.
I've tried removing it from the libast/features/common file as given
below
--- INIT.2011-02-08.old/src/lib/libast/features/common 2015-06-17
13:46:27.643760200 -0700
+++ INIT.2011-02-08/src/lib/libast/features/common 2015-06-17
13:49:27.771639200 -0700
@@ -1,7 +1,7 @@
iff AST_COMMON
hdr pthread,stdarg,stddef,stdint,inttypes,types,unistd
sys types
-typ long.double,size_t,ssize_t
+typ size_t,ssize_t
typ __va_list stdio.h
mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h
But this is causing lots of failures in the the math and arith test
suites.
So I guess this might not be the right way to do this.
If someone has any pointers on this, please let me know.
Thanks,
Lijo
lijo george
2015-09-14 10:05:25 UTC
Permalink
Sorry if I didn't make it clear

The base type in most of the arithmetic functions is Sfdouble_t,
which is defined as the following



#else
The C language, not the shell, defines that floating arithmetic has to be
done in double precision.
RÃŒdiger SchÃŒtz
Enzianstraße 32
D-85098 Großmehring
Tel.: +49 8407 930 257
Mobil: +49 178 811 8257
------ Originalnachricht ------
Gesendet: 14.09.2015 00:13:12
Betreff: [ast-developers] How to configure ksh93 to use double instead of
long double as the default type
Could someone let me know if it is possible at all to configure ksh93 to
use
only double precision instead of long double for arithmetic.
I've tried removing it from the libast/features/common file as given below
--- INIT.2011-02-08.old/src/lib/libast/features/common 2015-06-17
13:46:27.643760200 -0700
+++ INIT.2011-02-08/src/lib/libast/features/common 2015-06-17
13:49:27.771639200 -0700
@@ -1,7 +1,7 @@
iff AST_COMMON
hdr pthread,stdarg,stddef,stdint,inttypes,types,unistd
sys types
-typ long.double,size_t,ssize_t
+typ size_t,ssize_t
typ __va_list stdio.h
mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h
But this is causing lots of failures in the the math and arith test suites.
So I guess this might not be the right way to do this.
If someone has any pointers on this, please let me know.
Thanks,
Lijo
lijo george
2015-09-14 10:23:18 UTC
Permalink
Sorry for the previous mail which got sent accidentally.

I'll clarify the question again.

The base type in most of the arithmetic functions is Sfdouble_t,
which is defined as the following

#define Sfdouble_t _ast_fltmax_t

where
_ast_fltmax_t is defined in src/lib/libast/ast_common.h header file which
gets generated.
Here with the changes I tried out in features/common, it is defined to be
double as the following

#define _ast_flt8_t double
#define _ast_fltmax_t _ast_flt8_t

Without the changes it will be defined to long double.
#define _typ_long_double 1 /* long double is a type */

#define _ast_flt16_t long double
#define _ast_fltmax_t _ast_flt16_t

I was thinking that this would be enough for changing the default type,
but from the test suite failures, it looks like we might need to update
other places too.


Thanks,
Lijo
Post by lijo george
Sorry if I didn't make it clear
The base type in most of the arithmetic functions is Sfdouble_t,
which is defined as the following
#else
The C language, not the shell, defines that floating arithmetic has to be
done in double precision.
RÃŒdiger SchÃŒtz
Enzianstraße 32
D-85098 Großmehring
Tel.: +49 8407 930 257
Mobil: +49 178 811 8257
------ Originalnachricht ------
Gesendet: 14.09.2015 00:13:12
Betreff: [ast-developers] How to configure ksh93 to use double instead of
long double as the default type
Could someone let me know if it is possible at all to configure ksh93 to
use
only double precision instead of long double for arithmetic.
I've tried removing it from the libast/features/common file as given below
--- INIT.2011-02-08.old/src/lib/libast/features/common 2015-06-17
13:46:27.643760200 -0700
+++ INIT.2011-02-08/src/lib/libast/features/common 2015-06-17
13:49:27.771639200 -0700
@@ -1,7 +1,7 @@
iff AST_COMMON
hdr pthread,stdarg,stddef,stdint,inttypes,types,unistd
sys types
-typ long.double,size_t,ssize_t
+typ size_t,ssize_t
typ __va_list stdio.h
mac SF_APPEND,SF_CLOSE sys/stat.h sys/socket.h
But this is causing lots of failures in the the math and arith test suites.
So I guess this might not be the right way to do this.
If someone has any pointers on this, please let me know.
Thanks,
Lijo
Loading...