Paradoxial
Paradoxial
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
alright ima try to change that
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
doesnt tell me anything
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
yeah the vsc debugger is just shit :/
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
I should be able to do this in VSC right? Because thats what im using rn not VS
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
doesnt really tell me where NaN occurs when i debug it
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
------------------------------------------------------------------------------
You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you
develop and test your applications.
------------------------------------------------------------------------------
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Programming\C# Projects\paramath_c_sharp\bin\Debug\net7.0\paramath_c_sharp.dll'. Symbols loaded.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Hello from Tamer Alssaleh - Thank you for using Paramath C# Edition
NaN
The program '[976] paramath_c_sharp.exe' has exited with code 0 (0x0).
------------------------------------------------------------------------------
You may only use the Microsoft Visual Studio .NET/C/C++ Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you
develop and test your applications.
------------------------------------------------------------------------------
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Programming\C# Projects\paramath_c_sharp\bin\Debug\net7.0\paramath_c_sharp.dll'. Symbols loaded.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Console.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\7.0.9\System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Hello from Tamer Alssaleh - Thank you for using Paramath C# Edition
NaN
The program '[976] paramath_c_sharp.exe' has exited with code 0 (0x0).
this is all i get
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
Feel free to ping me if someone finds a solution
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
Around i < 20 causes the issue, however at i <5 - 10, the function just doesn't give a percise answer
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
This uses the exactly same algorithm and steps as the one I have written in Python and that works just fine.
29 replies
CC#
Created by Paradoxial on 5/19/2024 in #help
Why does this function return NaN?
public static double Sin(double angle) {
double result = 0;
double sign = 1;
angle %= 360;
angle = Radians(angle);
for (int i = 0; i < 20; i++) {
double term = Power(angle, 2 * i + 1) / IntFactorial(2 * i + 1);
result += sign * term;
sign *= -1;
}
return result;

}
public static double Sin(double angle) {
double result = 0;
double sign = 1;
angle %= 360;
angle = Radians(angle);
for (int i = 0; i < 20; i++) {
double term = Power(angle, 2 * i + 1) / IntFactorial(2 * i + 1);
result += sign * term;
sign *= -1;
}
return result;

}
29 replies