473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

how to write??

Hello all!
My question:
How to write (in Builder C++)
10^(-b*z)
cause i have no idea :(
Thanks for any help..
johnnyB
Jul 19 '05 #1
11 2234
janek wrote:
Hello all!
My question:
How to write (in Builder C++)
10^(-b*z)
cause i have no idea :(


If I am not mistaking it is pow(10.0, b*z); You need to include math.h

--
WW aka Attila
Jul 19 '05 #2
"janek" <si****@poczta.gazeta.pl> wrote in message
news:bk**********@inews.gazeta.pl...
Hello all!
My question:
How to write (in Builder C++)
10^(-b*z)
cause i have no idea :(
Thanks for any help..
johnnyB


I'm guessing, but try 'std::pow (10, - b * z)'.
You have to #include <cmath> first.
Jul 19 '05 #3
Buster wrote:
I'm guessing, but try 'std::pow (10, - b * z)'.
You have to #include <cmath> first.


Before we go into a debate again on the cmath/std:: vs. math/nostd I have
proposed the latter for two reasons. One: unfortunately I have seen
compilers where include a cxxx header is sure recipe for disater. The other
(way less important) is that it also works in C.

--
WW aka Attila
Jul 19 '05 #4
White Wolf wrote:
Before we go into a debate again on the cmath/std:: vs. math/nostd I have
proposed the latter for two reasons. One: unfortunately I have seen
compilers where include a cxxx header is sure recipe for disater. The other
(way less important) is that it also works in C.


Um.. this is C++ group, right? I think it is better to use C++ style,
rather than C style if we are writing C++ code. Even if the C code would
work. If the compiler can't handle the standard C++ there are two solutions:
- Get a better compiler (or new version).
- Use the bad/evil C-style as you suggested. But only if you are really
tied to that crappy compiler. ;)

I don't know any good reasons why someone should do this. I just think
that if you go to England, you should try to speak English there,
instead of Spain or some other language. I'm pretty sure they will
understand you better if you do so.

Jul 19 '05 #5
Aggro wrote:
White Wolf wrote:
Before we go into a debate again on the cmath/std:: vs. math/nostd I
have proposed the latter for two reasons. One: unfortunately I have
seen compilers where include a cxxx header is sure recipe for
disater. The other (way less important) is that it also works in C.
Um.. this is C++ group, right? I think it is better to use C++ style,
rather than C style if we are writing C++ code.


Is it? Even if it means your code not compiling anymore?
Even if the C code
would work. If the compiler can't handle the standard C++ there are
two solutions:
- Get a better compiler (or new version).
Obviously you do not work in a big company.
- Use the bad/evil C-style as you suggested. But only if you are
really tied to that crappy compiler. ;)
It is not bad or evil. It is standard.
I don't know any good reasons why someone should do this.
Because it is standard? Because it makes it possible to use the C style
code from both C and C++? Because it makes his code compile and work?
I just think
that if you go to England, you should try to speak English there,
instead of Spain or some other language. I'm pretty sure they will
understand you better if you do so.


Yes. But it is absolutely irrelevant here.

--
WW aka Attila
Jul 19 '05 #6
"White Wolf" <wo***@freemail.hu> wrote
Before we go into a debate again on the cmath/std:: vs. math/nostd I have
proposed the latter for two reasons. One: unfortunately I have seen
compilers where include a cxxx header is sure recipe for disater. The other
(way less important) is that it also works in C.


No argument here. My reasons for using cmath: (a) I thought it was less likely
to cause a flame war. (b) It looks cooler.

Peace out,
Buster.
Jul 19 '05 #7

"White Wolf" <wo***@freemail.hu> wrote in message
news:bk**********@phys-news1.kolumbus.fi...
Aggro wrote:
White Wolf wrote:
Before we go into a debate again on the cmath/std:: vs. math/nostd I
have proposed the latter for two reasons. One: unfortunately I have
seen compilers where include a cxxx header is sure recipe for
disater. The other (way less important) is that it also works in C.


Um.. this is C++ group, right? I think it is better to use C++ style,
rather than C style if we are writing C++ code.


Is it? Even if it means your code not compiling anymore?

You didn't know if the code would compile or not with *his* compiler. The
solution is to post it in the standard/ISO C++ code and then make a note:

"if this doesnt work with your compiler..."

Afterall, this is supposed to be a 'group for Standard C++, isn't it?
~
Jeremy

Jul 19 '05 #8
Jeremy Cowles wrote:
"White Wolf" <wo***@freemail.hu> wrote in message
news:bk**********@phys-news1.kolumbus.fi...
Aggro wrote:
White Wolf wrote:

Before we go into a debate again on the cmath/std:: vs. math/nostd
I have proposed the latter for two reasons. One: unfortunately I
have seen compilers where include a cxxx header is sure recipe for
disater. The other (way less important) is that it also works in
C.

Um.. this is C++ group, right? I think it is better to use C++
style, rather than C style if we are writing C++ code.


Is it? Even if it means your code not compiling anymore?

You didn't know if the code would compile or not with *his* compiler.
The solution is to post it in the standard/ISO C++ code and then make
a note:

"if this doesnt work with your compiler..."

Afterall, this is supposed to be a 'group for Standard C++, isn't it?


math.h and pow() without std *is standard C++*. Period.

--
WW aka Attila
Jul 19 '05 #9
Thanks a lot .. it's worked :)
johnnyB
Jul 19 '05 #10
"White Wolf" <wo***@freemail.hu> wrote in message news:<bk**********@phys-news1.kolumbus.fi>...
Jeremy Cowles wrote:
"White Wolf" <wo***@freemail.hu> wrote in message
news:bk**********@phys-news1.kolumbus.fi...
Aggro wrote:
White Wolf wrote:

> Before we go into a debate again on the cmath/std:: vs. math/nostd
> I have proposed the latter for two reasons. One: unfortunately I
> have seen compilers where include a cxxx header is sure recipe for
> disater. The other (way less important) is that it also works in
> C.

Um.. this is C++ group, right? I think it is better to use C++
style, rather than C style if we are writing C++ code.

Is it? Even if it means your code not compiling anymore?

You didn't know if the code would compile or not with *his* compiler.
The solution is to post it in the standard/ISO C++ code and then make
a note:

"if this doesnt work with your compiler..."

Afterall, this is supposed to be a 'group for Standard C++, isn't it?


math.h and pow() without std *is standard C++*. Period.


Yes, but the xxx.h headers are deprecated in favour of cxxx aren't
they? I can see where you're coming from. I don't use cxxx myself
headers because my compiler doesn't put the names in the std namespace
at all. But I think it is appropriate to prefer the non-deprecated
answer here.

GJD
Jul 19 '05 #11
Gavin Deane wrote:
Afterall, this is supposed to be a 'group for Standard C++, isn't
it?
math.h and pow() without std *is standard C++*. Period.


Yes, but the xxx.h headers are deprecated in favour of cxxx aren't
they?


They are. But deprecated does not mean they are not part of the standard.
And if you ask (as I did) the intentions of people on the comitee you would
also know there as of today (when designing the C++ for the next 10 years)
there are absolutely no intentions to remove those headers-
I can see where you're coming from. I don't use cxxx myself
headers because my compiler doesn't put the names in the std namespace
at all.
Then I guess you see what I mean. :-) This topic is not black and white.
But I think it is appropriate to prefer the non-deprecated
answer here.


I was like this for a while as well until some very well known names have
convinced me otherwise. Anyway it is worth to mention that there are those
cxxx headers and that (in theory) they should be used.

--
Attila aka WW
Jul 19 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Greg Hurlman | last post by:
I've got what I'm sure is a very simple problem. In an ASP page, I am trying to write out 4 fields from a recordset in succession: Response.Write rs("LastName") Response.Write rs("Suffix")...
1
by: techy techno | last post by:
Hii Just wanted to know how can I decorate my texboxes and Listmenu which is called from a JS file using the following code below: document.write("<SELECT NAME='cur2' ONCHANGE='cconv1();'>");...
2
by: Brett Baisley | last post by:
Hello I have a block of html code that I want to run by calling a javascript function to print it. Its basically a table with menu items in it that is the same for many pages, and instead of...
0
by: hari krishna | last post by:
hi all, My requirement is to generate xl reports throu Asp.Net without installing xl on web server computer. i am using Response object and wrtifile method as below. i dont know whether it is...
8
by: Ben | last post by:
Hi all, Just wondering how to write (using document.write) to a table cell. I have table with 3 rows and 3 colums. I want to write from within the Javascript to say third column of a first row....
4
by: Prowler | last post by:
In the application we are currently building, we need to write positioning code on-the-fly, based upon the screen offset of the element in the AS/400 application which drives the Web app. The 400,...
11
by: Vmusic | last post by:
Hi, I am trying to write out an array of string variables to Notepad. I can't get SendKeys to accept the string variable only literal quoted strings. I DO NOT want the hassle of writing to a...
4
by: cbtechlists | last post by:
I have an ASP app that we've moved from a Windows 2000 to a Windows 2003 server (sql server 2000 to sql server 2005). The job runs fine on the old servers. Part of the app takes a recordset and...
0
by: kuguy | last post by:
Hi all, I'm new to the forums, so I hope this isn't in the wrong place... I have that "Software caused connection abort: socket write error" exception error that i've never meet before. ...
8
by: Mateusz Viste | last post by:
Hi, I am trying make some multimedia files playable from my website. So far, I am able to generate dynamically a new page containing the right <embed> section. However, when I load my script, it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.