Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,258 Programmers. There are 2,031 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

Problem related to COBOL programming language

 
Reply to this topicStart new topic

Problem related to COBOL programming language

ketaki
post 28 Apr, 2008 - 04:08 AM
Post #1


New D.I.C Head

*
Joined: 12 Feb, 2008
Posts: 7



Sir,

In case of COBOL language, if we want to raise the power e.g. we need to find out 2 raise to power 2 is how much.......means square of 2,

We can use

COMPUTE C = 2 ** 2.

this will work and after execution of this statement C will contain 4.

but if I will raise the power by decimal number, it wont work....e.g.

COMPUTE C = 4 ** (0.5).

but after execution of this statement C should contain 2....... but I am getting error.......

Kindly help me

Ketaki
User is offlineProfile CardPM
Go to the top of the page
+Quote Post


BenignDesign
post 28 Apr, 2008 - 09:28 AM
Post #2


D.I.C Regular

Group Icon
Joined: 28 Sep, 2007
Posts: 484

Alright. Rewrite that a little more clearly and I'll see what I can do for you.

I think I know what you're trying to do, but I'm not totally sure.

It might be best to modify the decimal exponent.

As in, the user enters X^0.5, modify the exponent so the output is X/2?

Same with X^0.25... modified to X/4, etc, etc

As in if exp<1, then Y=1/exp and Z=X/Y?

Is this making any sense at all?

This post has been edited by BenignDesign: 28 Apr, 2008 - 09:32 AM
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

ketaki
post 30 Apr, 2008 - 01:00 AM
Post #3


New D.I.C Head

*
Joined: 12 Feb, 2008
Posts: 7

Thank you Sir for your kind reply. May I send the code?

ketaki
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

BenignDesign
post 30 Apr, 2008 - 03:51 AM
Post #4


D.I.C Regular

Group Icon
Joined: 28 Sep, 2007
Posts: 484

Send it where? You can post it here if you'd like and I can take a look at it.

code.gif
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:49AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month