HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
17 user(s) are online (9 user(s) are browsing Forum)

Members: 0
Guests: 17

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     OC 1.1 floating point bug - FYI
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
ska
Posted on: 2012/10/13 1:34
Just can't stay away
Joined: 2008/3/17
From: NYC
Posts: 145
OC 1.1 floating point bug - FYI
Hi Folks,

With some of our latest development I've faced couple of issues:

1. I see display-numeric-float not implemented at all, i.e.
       01  FLOAT-PICOUT                  PIC -9.9(15)E+99.

just producing error in 1.1 and even in pre-2.0

2. In 1.1 the following code does not work right:
       01  F   USAGE COMP-2.
...
           CALL 'XXX' USING
                BY VALUE F.


It is passing only 1 byte
But that one is okay in pre-2.0.
Will look at it when I get a time


----------------
Regards,
Sergey

btiffin
Posted on: 2012/10/13 2:41
Webmaster
Joined: 2008/6/7
From: CANADA
Posts: 1196
Re: OC 1.1 floating point bug - FYI
Sergey; I'm not on a box with a compiler installed, but OC supports call with size override. I can't test, so I could be off base. (Haven't got source, nor notes so I'm not sure about parser.y ordering)

CALL 'XXX' USING SIZE AUTO or 1 2 (3?) 4 upto 8 I think BY VALUE F.


Cheers,
Brian
human
Posted on: 2012/10/15 6:34
Webmaster
Joined: 2007/5/15
From: GERMANY
Posts: 1416
Re: OC 1.1 floating point bug - FYI
Thank you for this information and the upcoming fix for both in CE

Simon
ska
Posted on: 2012/10/15 16:37
Just can't stay away
Joined: 2008/3/17
From: NYC
Posts: 145
Re: OC 1.1 floating point bug - FYI
Hi Brian,

CALL 'XXX' USING BY VALUE SIZE 8 F.


Does not work. The same story.


----------------
Regards,
Sergey

ska
Posted on: 2012/10/15 17:49
Just can't stay away
Joined: 2008/3/17
From: NYC
Posts: 145
Re: OC 1.1 floating point bug - FYI
Hi Human,

So far it does not make a sense for CE, as CE parser is weak in floating point stuff:

           MOVE 3.1415E21 TO F.


does not compile...

But for 1.1 in codegen.c in function output_call_by_value_args you can add

		case CB_USAGE_FLOAT:
			output ("*(float *)(");
			output_data (x);
			output (")");
			return;
		case CB_USAGE_DOUBLE:
			output ("*(double *)(");
			output_data (x);
			output (")");
			return;


before "default" at the end of the function.


----------------
Regards,
Sergey

ska
Posted on: 2012/10/16 13:16
Just can't stay away
Joined: 2008/3/17
From: NYC
Posts: 145
Re: OC 1.1 floating point bug - FYI
Also, parsing of FP constants is not good even in pre-2
       01  F   USAGE COMP-2 VALUE .12E00.


producing error.


----------------
Regards,
Sergey

Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net