Recent Posts

Pages: [1] 2 3 ... 10
1
The Workshop / Re: C pow()
« Last post by TimoVJL on Today at 12:58:17 AM »
ISO/IEC 9899:TC2 Committee Draft — May 6, 2005 WG14/N1124
Quote
7.12.7.4 The pow functions
Synopsis
1 #include <math.h>
double pow(double x, double y);
float powf(float x, float y);
long double powl(long double x, long double y);
Description
2 The pow functions compute x raised to the power y. A domain error occurs if x is finite
and negative and y is finite and not an integer value. A range error may occur. A domain
error may occur if x is zero and y is zero. A domain error or range error may occur if x
is zero and y is less than zero.
Returns
3 The pow functions return x y
2
The Workshop / Re: C pow()
« Last post by Biterider on Today at 12:45:57 AM »
Hi JJ
On my Calc.exe (10.1906.53.0 - Win10) the result using x^y is positive, which is mathematically correct.

Biterider
3
The Workshop / C pow()
« Last post by jj2007 on Today at 12:38:41 AM »
I'm working on a better version of ExpXY(a, b):
Code: [Select]
  For_ fct=1.7 To 2.3 Step 0.1
Print Str$("\n-1.23 ** %3f", fct), Str$("\tMB: %4f  ", ExpXY2(-1.23, fct)v)
invoke crt_pow, FP8(-1.23), fct
Print Str$("\t C pow: %4f", ST(0)v)
  Next

Output:
Code: [Select]
-1.23 ** 1.70   MB: -1.422       C pow: 0.0
-1.23 ** 1.80   MB: -1.452       C pow: 0.0
-1.23 ** 1.90   MB: -1.482       C pow: 0.0
-1.23 ** 2.00   MB: -1.513       C pow: 1.513
-1.23 ** 2.10   MB: -1.545       C pow: 0.0
-1.23 ** 2.20   MB: -1.577       C pow: 0.0
-1.23 ** 2.30   MB: -1.610       C pow: 0.0

The Windows calculator has no problems with the negative input, and comes to the same results as MB. The docs on pow() are remarkably silent on that point, e.g. https://www.tutorialspoint.com/c_standard_library/c_function_pow.htm

I vaguely remember an old math rule that a negative number squared yields a positive result. But it looks rather inconsistent, and the Windows calculator confuses me even more:
-1.23^2 = -1.5129 using x^y
-1.23^2 = +1.5129 using x²

 :rolleyes:
4
The Soap Box / Re: Hiding desktop.ini
« Last post by AW on September 20, 2019, 10:32:58 PM »
There is a guy from here that uses a rotating yellow avatar that downvotes all my posts on Codeproject. This is happening since long. I don't care much, although it upsets when idiots do things for pure and stupid reveange.
5
The Soap Box / Re: Hiding desktop.ini
« Last post by AW on September 20, 2019, 08:06:24 PM »
I have just posted the article at Codeproject.com

https://www.codeproject.com/Articles/5246433/No-more-desktop-ini-icons-on-the-desktop

The program is significantly different than the one I posted here, which contained a few bugs. So I am going to remove it.
6
The Soap Box / Re: 64-layer flash memory chip goes into mass production in China
« Last post by Biterider on September 20, 2019, 07:35:31 PM »
Hi
Very interesting technology. For sure it is the future of our data storage!


Biterider
7
The Soap Box / 64-layer flash memory chip goes into mass production in China
« Last post by hutch-- on September 20, 2019, 05:06:03 PM »
This looks like an interesting technology, massive very high speed storage of data that is persistent. We may yet see the end of HDDs.

https://www.youtube.com/watch?v=6j3SeP180f4
8
The Colosseum / Rugby World Cup 2019
« Last post by Raistlin on September 20, 2019, 03:06:02 PM »
So for the real sports enthusiasts, the rugby world cup starts in Japan today.
The best games to watch are actually only tomorrow. Looking forward to
the Australia vs Fiji, South Africa vs New Zealand, France vs Argentina games
especially. Place your bets here ... (masm32 sports betting dot com)  :biggrin: 
9
@asmguru

The default is do it like MASM, this will do what you want:

Code: [Select]
; uasm64 -c /Flfile.lst -win64 -Zp8 test.asm
; link /ENTRY:xyz /SUBSYSTEM:console /MACHINE:X64 test.obj

option win64:7
option frame:noauto

.code
.listall

     xyz     proc    arg1:ptr
mov     rax, arg1
ret
xyz     endp

    end
10
Ml64 has a different calling convention than ml. There is no proc. Read the masm64 help file. It has all the information you need.
Pages: [1] 2 3 ... 10