Is it possible to get information from a minecraft server without needing a minecraft user?
Just stuff like the amount of players it allows and stuff like that?
Should also say that this would be over the internet so not locally
[QUOTE=T3hGamerDK;30570453]I just tried the above code, but the value seems to be nil for some reason.[/QUOTE]
I just tested it as well. It works fine.
(Using my code for the C++ program, and your example Lua code for myscript.lua)
[QUOTE=T3hGamerDK;30570453](Reason: PANIC: unprotected error in call to Lua API (attempt to call a nil value))[/QUOTE]
If there is no global variable named "bleh" (case-sensitive) by the end of myscript.lua, this error would occur. Either the function "bleh" was never defined, or the value of "bleh" was later set to nil before the end of the script.
[QUOTE=T3hGamerDK;30570453]And nothing happens when doing a pcall instead of call.[/QUOTE]
lua_pcall returns non-zero and pushes an error to the stack if an error occurs while calling the supplied function. lua_call raises an error; if no error handler (like a call to pcall or lua_pcall) is currently present somewhere up the stack, the panic function is called and the program aborted. That means with lua_pcall, the burden of handling the error is on you - don't use it unless you're planning on handling the error then and there.
[QUOTE=T3hGamerDK;30570453]It may be worth noting the following though, as I forgot to mention them earlier:
I've already done a lua_pcall on the script, to run some whatever is NOT a function. [highlight](What do you mean?)[/highlight]
Do I need to somehow "empty" the lua state and reload the script and THEN load the functions, or should I be able to do it straight forward?[/QUOTE]
There is no need to reset the Lua state (BTW, you would have to create a new one for that), everything that needs to be present for the last bit of your C++ code is a global variable named "onExit", such as the one defined in log.lua.
It's important to note that you're not actually handling any error that might have occurred if luaL_loadfile failed: you're just ignoring it, and to make it worse, you're not actually calling the loaded function (your script) if an error [i]did[/i] occur (which is bad because lua_pcall would in some way hint at the error). My guess is that loading log.lua somehow failed and that's why onExit doesn't exist. In your case you should be using luaL_dofile and handling errors in a similar fashion to my example.
Others things to note: use luaL_newstate instead of the deprecated lua_open, and don't use LUA_MULTRET unless you're actually expecting a variable number of return values.
edit:
Looking at the log.lua paste again; the first line is not actually there, right? Single-line comments in Lua are done with --, not #. luaL_loadfile would fail on such input.
Can someone help me get this box2d thing to simulate? I made a quick prototype program to try to implement SFML and box2d together with a class but the problem is, the box that is suppose to be falling on the ground plane isn't moving.
main.cpp
[code]
#include <SFML/Graphics.hpp>
#include <Box2d/Box2D.h>
#include "general.h"
int main() {
//Create the SFML Window
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "SFML Window");
//Make a Reference to the Input Handler
const sf::Input& input = Game.GetInput();
//Create SFML Event Handler
sf::Event Event;
//Make View
sf::View cam = Game.GetDefaultView();
//Box2D World Settings
b2Vec2 gravity(0.0f, -9.81f);
bool doSleep = true;
int32 iterations = 10;
float timeStep = 1/60;
b2World world(gravity, doSleep);
//Ground Box Color
sf::Color groundC[4];
for (int i = 0; i < 4; ++i) {
groundC[i] = sf::Color(255, 0, 0);
}
//Dynamic Box Color
sf::Color boxC[4];
for (int i = 0; i < 4; ++i) {
boxC[i] = sf::Color(0, 0, 255);
}
//Make the boxes
shape groundBox(b2_staticBody, world, 0.0f, -10.f, 0, 0, makeBox(50, 10), groundC, sf::Color(), 0.0f, 4);
shape dynamicBox(b2_dynamicBody, world, 0.0f, 4.0f, 1.0f, 0.3f, makeBox(1, 1), boxC, sf::Color(), 0.0f, 4);
//Center view on the dynamic box, rotate view, and zoom in
cam.SetCenter(dynamicBox.getBody()->GetWorldCenter().x, dynamicBox.getBody()->GetWorldCenter().y);
cam.Rotate(180.f);
cam.Zoom(0.12f);
Game.SetView(cam);
//Game Loop
while (Game.IsOpened()) {
//Event Handler Loop
while (Game.PollEvent(Event)) {
//If 'X'd out, close the game window
if (Event.Type == sf::Event::Closed) {
Game.Close();
}
}
//If escape is pressed, then close the game window
if (input.IsKeyDown(sf::Key::Escape)) {
Game.Close();
}
//Clear the Game Window
Game.Clear(sf::Color(100, 149, 237));
//Calculate the positions and stuff
world.Step((1/60), 10, 10);
world.ClearForces();
//Update the position and angles of the SFML shapes
groundBox.update();
dynamicBox.update();
//Draw the shapes
Game.Draw(groundBox.getShape());
Game.Draw(dynamicBox.getShape());
//Display SFML graphics to the window
Game.Display();
}
return EXIT_SUCCESS;
}
[/code]general.h
[code]
static const double PI = 2*acos(0.0);
class shape {
public:
shape(b2BodyType bodyType, b2World &world, float x, float y, float density, float friction, b2Vec2 *verticies, sf::Color *colors, sf::Color outline, float outlineWidth, int vCount);
~shape() {}
void update();
sf::Shape getShape() const { return polygon; }
b2Body* getBody() const { return body; }
private:
//Box2D
b2BodyDef bodyDef;
b2Body* body;
b2PolygonShape b2Polygon;
b2FixtureDef fixtureDef;
//SFML
sf::Shape polygon;
};
shape::shape(b2BodyType bodyType, b2World &world, float x, float y, float density, float friction, b2Vec2 *verticies, sf::Color *colors, sf::Color outline, float outlineWidth, int vCount) {
//Box2D
bodyDef.type = bodyType;
bodyDef.position.Set(x, y);
body = world.CreateBody(&bodyDef);
b2Polygon.Set(verticies, vCount);
fixtureDef.shape = &b2Polygon;
fixtureDef.density = density;
fixtureDef.friction = friction;
body->CreateFixture(&fixtureDef);
//SFML
for (int i = 0; i < vCount; ++i) {
polygon.AddPoint(verticies[i].x, verticies[i].y, colors[i], outline);
}
polygon.SetOutlineThickness(outlineWidth);
polygon.SetPosition(x, y);
}
void shape::update() {
polygon.SetPosition(body->GetPosition().x, body->GetPosition().y);
polygon.SetRotation(body->GetAngle() * (180.f/PI));
}
b2Vec2 *makeBox(float x, float y) {
b2Vec2 temp[4];
temp[0].Set(-x, y);
temp[1].Set(-x, -y);
temp[2].Set(x, -y);
temp[3].Set(x, y);
return temp;
}
[/code]I don't know what the problem is, I'm new to SFML and Box2D so yea.
C#
I am using .AddRange to add a bunch of filenames, to a list, from different locations. Then I want to sort them for easy searching and whatnot, but list.sort sorts the individual ranges and not all of them as one big list.
Now, I'm new to C# so I don't exactly know what's going on.
[QUOTE=jA_cOp;30571826]I just tested it as well. It works fine.
(Using my code for the C++ program, and your example Lua code for myscript.lua)
If there is no global variable named "bleh" (case-sensitive) by the end of myscript.lua, this error would occur. Either the function "bleh" was never defined, or the value of "bleh" was later set to nil before the end of the script.
lua_pcall returns non-zero and pushes an error to the stack if an error occurs while calling the supplied function. lua_call raises an error; if no error handler (like a call to pcall or lua_pcall) is currently present somewhere up the stack, the panic function is called and the program aborted. That means with lua_pcall, the burden of handling the error is on you - don't use it unless you're planning on handling the error then and there.
There is no need to reset the Lua state (BTW, you would have to create a new one for that), everything that needs to be present for the last bit of your C++ code is a global variable named "onExit", such as the one defined in log.lua.
It's important to note that you're not actually handling any error that might have occurred if luaL_loadfile failed: you're just ignoring it, and to make it worse, you're not actually calling the loaded function (your script) if an error [i]did[/i] occur (which is bad because lua_pcall would in some way hint at the error). My guess is that loading log.lua somehow failed and that's why onExit doesn't exist. In your case you should be using luaL_dofile and handling errors in a similar fashion to my example.
Others things to note: use luaL_newstate instead of the deprecated lua_open, and don't use LUA_MULTRET unless you're actually expecting a variable number of return values.
edit:
Looking at the log.lua paste again; the first line is not actually there, right? Single-line comments in Lua are done with --, not #. luaL_loadfile would fail on such input.[/QUOTE]
Thanks a bunch! I tried doing the code the same way you did yours (which really does seem more logical as well), and I double-checked the code in the log.lua file and you were right. I had it print all the errors, and it closes the script as soon as it reaches anything past "LOG =", since I was doing the lua coding wrong.
Seems I need to re-learn lua again.
Thanks!
So I'm trying to do integer division that rounds to the nearest integer instead of always flooring. I've come up with this:
[code]def int_div(a,b):
""" Properly rounded integer division. """
if b < 0:
a,b = -a,-b
if (a % b) * 2 >= b:
return a // b + 1
else:
return a // b
[/code]
The problem is, it's 2.5x slower than regular int division, which seems a bit pointless for such a small improvement of results. Is there any faster algorithm for doing it?
[url]http://stackoverflow.com/questions/6416725/platform-jumping-problems-with-aabb-collisions[/url]
Can anyone help? I can't figure out a way to solve this
[QUOTE=SupahVee;30590567][url]http://stackoverflow.com/questions/6416725/platform-jumping-problems-with-aabb-collisions[/url]
Can anyone help? I can't figure out a way to solve this[/QUOTE]
I've had this exact same problem before, [I]please[/I] tell me if you find a solution, I couldn't think of anything to fix it
Anyone know how to return an enum in C#?
do you mean the enum type itself or a value of a specific enum?
If you mean a specific value (say you have a "public enum MyEnum { option1, option2 }")
[csharp]public MyEnum DoSomething(int i)
{
if (i > 5)
return MyEnum.option1;
return MyEnum.option2;
}[/csharp]
if you want it to return the enum type,
[csharp]public Type GetEnumType()
{
return typeof(MyEnum);
}[/csharp]
Can't you just return MyEnum.SomeEnum ?
[QUOTE=pebkac;30589589]So I'm trying to do integer division that rounds to the nearest integer instead of always flooring. I've come up with this:
[code]def int_div(a,b):
""" Properly rounded integer division. """
if b < 0:
a,b = -a,-b
if (a % b) * 2 >= b:
return a // b + 1
else:
return a // b
[/code]
The problem is, it's 2.5x slower than regular int division, which seems a bit pointless for such a small improvement of results. Is there any faster algorithm for doing it?[/QUOTE]
If there's no function for calculating the quotient and modulus of a division simultaneously, you can't really get faster than that in the language itself.
I don't know how Python works but I'd assume that you can write and compile an extension for it in C. In that case one would just use subsequent division and modulus operations and trust that the compiler knows how to optimize it into an idiv, assuming the architecture supports it.
In short, is the speed gain worth the trouble?
[QUOTE=Chris220;30591194]I've had this exact same problem before, [I]please[/I] tell me if you find a solution, I couldn't think of anything to fix it[/QUOTE]
Solved. Added you on steam for explanation
[QUOTE=SupahVee;30593915]Solved. Added you on steam for explanation[/QUOTE]
Please post a summary here for someone who may come across the post later.
[QUOTE=ThePuska;30592252]If there's no function for calculating the quotient and modulus of a division simultaneously, you can't really get faster than that in the language itself.
I don't know how Python works but I'd assume that you can write and compile an extension for it in C. In that case one would just use subsequent division and modulus operations and trust that the compiler knows how to optimize it into an idiv, assuming the architecture supports it.
In short, is the speed gain worth the trouble?[/QUOTE]
I've actually heard from someone a while ago that the CPU calculates the modulo and quotient simultaneously, so naturally I checked if there's a built-in function that does that. Turns out that there is, it's divmod(), but for some reason it's slower than doing them separately. I guess the implementation just sucks.
Anyway, I'll probably keep using my way of doing it, and if it turns out to be too slow for my purposes, I'll just use normal integer division as the extra precision isn't that important.
Never mind, I fixed my error, it turned out 1 / 60 isn't automatically floating point arithmetic so it just evaluated to zero instead.
[QUOTE=SupahVee;30593915]Solved. Added you on steam for explanation[/QUOTE]
Didn't get an invite so I sent one to you instead :v:
[QUOTE=Lord Ned;30594204]Please post a summary here for someone who may come across the post later.[/QUOTE]
[url]http://forums.tigsource.com/index.php?topic=20157.0[/url]
second post is the technique I used
Here's the source code
[url]http://pastebin.com/bU6FE6BG[/url]
[editline]21st June 2011[/editline]
Why does 128.1 - 128.0 gives me a stupid number with a lot of digits after the floating point? (both numbers are floats)
How do I prevent this?
[QUOTE=SupahVee;30603252]Why does 128.1 - 128.0 gives me a stupid number with a lot of digits after the floating point?[/QUOTE]
One-tenth can't be represented precisely in binary, just like one-third can't be represented precisely in decimal.
HLSL
In one of my shaders I have "float Attenuation = saturate(1.0f - dot(Direction, Direction));", the shader compiles fine when I don't include 'Attenuation' in "Output.Color = Color * Attenuation * pColor * pIntensity + (Specular * Attenuation * pSpecularIntensity);" I've narrowed it down to dot(Direction, Direction) causing the compilation failure. Direction is a float3 vector.
Any ideas why it's failing?
This is the error I get:
[code]
C:\Projects\The Attic\The Attic\The AtticContent\Effects\Lighting.fx(80,6): error : Errors compiling C:\Projects\The Attic\The Attic\The AtticContent\Effects\Lighting.fx:
C:\Projects\The Attic\The Attic\The AtticContent\Effects\Lighting.fx(80,6): error : (80,6): warning X3576: semantics in type overridden by variable/function or enclosing type
C:\Projects\The Attic\The Attic\The AtticContent\Effects\Lighting.fx(80,6): error : (123,17): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
C:\Projects\The Attic\The Attic\The AtticContent\Effects\Lighting.fx(80,6): error : ID3DXEffectCompiler: Compilation failed
[/code]
[QUOTE=Wyzard;30604534]One-tenth can't be represented precisely in binary, just like one-third can't be represented precisely in decimal.[/QUOTE]
What he said. If you want to get rid of all those decimals, just round the result. According to Wikipedia, a 32bit float can get about 7 significant digits right in decimal representation, and a 64bit float about 15 digits. Unless you round the result though, you'll get an [U]exact[/U] decimal representation of the float, including all the "incorrect" digits.
Now, I just started coding c++ about 4 hours ago, I've been coding lua for about 6 months now so I know syntax, essentially what I'm attempting to do is instead of having to do the cout shit I'm trying to create a 'function' I guess called print, y'know make life simpler :P so here's what I have so far; know this I have no idea what the fuck I'm doing :v: so if I could get an explaination I'd appreciate it :buddy:
[lua]
#include "stdafx.h"
#include <iostream>
#include <string>
int m_add(int a, int b)
{
return a + b;
}
int m_divide(int a, int b)
{
return a/b;
}
int m_mul(int a, int b)
{
return a * b;
}
int print(string a)
{
return a;
}
int main()
{
using namespace std;
cout <<" s1 "<< endl;
}
[/lua]
and I'm getting these syntax errors;
[code]
1>c:\users\rac\documents\visual studio 2005\projects\training\training\training.cpp(23) : error C2146: syntax error : missing ')' before identifier 'a'
1>c:\users\rac\documents\visual studio 2005\projects\training\training\training.cpp(23) : error C2059: syntax error : ')'
1>c:\users\rac\documents\visual studio 2005\projects\training\training\training.cpp(24) : error C2143: syntax error : missing ';' before '{'
1>c:\users\rac\documents\visual studio 2005\projects\training\training\training.cpp(24) : error C2447: '{' : missing function header (old-style formal list?)
[/code]
[QUOTE=bootv2;30605080]if this is just for using a simple function for this, and not for practice, why not use printf()?
[editline]21st June 2011[/editline]
you can't return a string in a integer function, that's what you're trying to do on line 23.
if you want to return a string, make the function a string.[/QUOTE]
Tried doing this
[lua]
string cus_print(string str)
{
return cout << str << endl;
}
[/lua]
No luck :v:.
hnnnnnngggggggg, this gonna take a long time to learn.
[url]http://stackoverflow.com/q/6422293/598696[/url]
another problem with the physics... this time it's because of floating point precision
[QUOTE=jrj996;30604950]Now, I just started coding c++ about 4 hours ago, I've been coding lua for about 6 months now so I know syntax, essentially what I'm attempting to do is instead of having to do the cout shit I'm trying to create a 'function' I guess called print, y'know make life simpler :P[/QUOTE]
It sounds like you're trying to make your C++ code look like the Lua code you're familiar with. That's not a good way to learn the language. Different languages have different idioms, and generally those idioms are established for good reasons; you should familiarize yourself with this one, and stick with it until you have enough experience to recognize when it's appropriate to take a different path.
C++ iostreams (cout, etc.) are versatile and not difficult to use. Your print() function will be less versatile — you don't know C++ well enough yet to come up with a good general-purpose I/O API — and while it may seem easier to you because you're not accustomed to using cout yet, any C++ programmer looking at your code will ask "why did he put a pointless wrapper around cout instead of just using cout normally?"
If you're going to learn C++, jump in and learn C++. Do things the C++ way. :-)
Also, why did you put pointless wrappers around the +, /, and * operators instead of just using them normally?
[QUOTE=SupahVee;30606089][url]http://stackoverflow.com/q/6422293/598696[/url]
another problem with the physics... this time it's because of floating point precision[/QUOTE]
The answer is that you need to check for equality with an epsilon (the smallest amount numbers can differ at a certain accuracy) and Krom's solution seems to explain that on StackOverflow.
[QUOTE=SupahVee;30603252]Why does 128.1 - 128.0 gives me a stupid number with a lot of digits after the floating point? (both numbers are floats)[/QUOTE]
Oh that's pretty easy to explain.
See, a float (single-precision floating point) is a four-byte (32-bit) binary string consisting of the following sections of information:
[code]1 bit for the sign
8 bits for the exponent, biased with 127
23 bits for the significand[/code]
Every single-precision floating point is thus written on the form:
[img]http://latex.codecogs.com/gif.download?a_{float}&space;=&space;s&space;%5Ccdot&space;(1.f)_{2}&space;%5Ccdot&space;2^{e-127}[/img],
where [i]s[/i] is the sign (-1 or 1 mathematically, stored as either 1 or 0 respectively), [i]f[/i] is the binary significand (such that 1.[i]f[/i] = [i]m[/i] where [i]m[/i] is the mantissa), and [i]e[/i] is the biased exponent.
So, moving on, let's define the following numbers:
[img]http://latex.codecogs.com/gif.download?%5C%5Ca&space;:=&space;128.1,%5C%5C&space;b&space;:=&space;128.0,%5C%5C&space;c&space;:=&space;a&space;-&space;b&space;=&space;128.1&space;-&space;128.0[/img]
Starting with [i]a[/i], we need to find this number in binary and normalize it:
[img]http://latex.codecogs.com/gif.download?a&space;=&space;10000000.0001100110011001100110011001100110011..._{2}%5C%5C&space;=&space;1.00000000001100110011001100110011001100110011..._{2}&space;%5Ccdot&space;2^{7}[/img]
Next step is to bias the exponent:
[img]http://latex.codecogs.com/gif.download?7&space;=&space;e&space;-&space;127&space;%5CRightarrow&space;e&space;=&space;7&space;+&space;127&space;=&space;134&space;=&space;10000110_{2}[/img]
Then we need to realize that we only have 23 bits available to store the significand, but we have a number with an infinitely repeating 00110011. So we simply cut it down to 23 bits, rounding up or down depending on the 24th bit:
[img]http://latex.codecogs.com/gif.download?%5C%5C24%5Ctextup{th}&space;%5C:&space;%5Ctextup{bit}&space;=&space;1%5C%5C&space;%5CRightarrow&space;m&space;=&space;1.00000000001100110011010_{2}&space;=&space;1.f%5C%5C&space;%5CRightarrow&space;f&space;=&space;00000000001100110011010_{2}[/img]
Finally, since a is positive, the sign will be 0. So, we have enough information now to store [i]a[/i] as a floating point, and it'll be stored as:
[code]0 10000110 00000000001100110011010[/code]
Note that while this isn't exactly 128.1, it's fairly close.
[img]http://latex.codecogs.com/gif.download?1.00000000001100110011010_{2}&space;%5Ccdot&space;2^{7}&space;=&space;128.100006103515625&space;%5Capprox&space;128.1[/img]
Notice how the [i]absolute[/i] error here is 0.000006103515625. The [i]relative[/i] error is:
[img]http://latex.codecogs.com/gif.download?%5Cleft&space;|%5Cfrac{128.100006103515625-128.1}{128.1}&space;%5Cright&space;|&space;%5Capprox&space;4.76&space;%5Ccdot&space;10^{-6}&space;%5C%[/img],
or a little less than five millionths of one percent.
As for [i]b[/i], being a power of two it's possible to represent it exactly:
[img]http://latex.codecogs.com/gif.download?%5C%5Cb&space;=&space;10000000_{2}%5C%5C&space;=&space;1.000000000000000000000000..._{2}&space;%5Ccdot&space;2^{7}[/img]
So, this one's pretty easy. We have the same exponent as before, the sign is still 0 (for positive), and the significand is all zeros. Thus, [i]b[/i] is represented as follows:
[code]0 10000110 00000000000000000000000[/code]
As for the subtraction, [i]c[/i], it is performed on floating points much like you would perform subtraction with scientific notation. Usually, we shift the smaller number to get the exponent of the larger one, but our numbers both have the same exponent.
In fact, the actual subtraction of our numbers will be very simple. The significand of [i]b[/i] is all zeros, and we can infer from this that the resulting subtracted significand will be the same as the one for [i]a[/i]. The difference though, is that the leading 1 of the [i]mantissa[/i] will be subtracted. After the subtraction we simply normalize, and get:
[img]http://latex.codecogs.com/gif.download?%5C%5Cc&space;=&space;a&space;-&space;b%5C%5C&space;=&space;(1.00000000001100110011010_{2}&space;-&space;1.00000000000000000000000_{2})%5Ccdot2^{7}%5C%5C&space;=&space;0.00000000001100110011010_{2}&space;%5Ccdot&space;2^{7}%5C%5C&space;=&space;1.100110011010&space;%5Ccdot&space;2^{7-11}%5C%5C&space;=&space;1.10011001101000000000000&space;%5Ccdot&space;2^{-4}[/img]
We now have a new exponent, and in its biased form we get:
[img]http://latex.codecogs.com/gif.download?-4&space;=&space;e&space;-&space;127&space;%5CRightarrow&space;e&space;=&space;127&space;-&space;4&space;=&space;123&space;=&space;01111011_{2}[/img]
Thus, [i]c[/i] = [i]a[/i] - [i]b[/i] will be stored as:
[code]0 01111011 10011001101000000000000[/code]
Now, as you may have guessed, we've lost a fuckload of precision by doing this. The correct result would've been [i]c[/i] = 0.1, but we get:
[img]http://latex.codecogs.com/gif.download?%5C%5C1.10011001101000000000000_{2}&space;%5Ccdot&space;2^{-4}%5C%5C&space;=&space;0.000110011001101_{2}%5C%5C&space;=&space;0.100006103515625&space;%5Capprox&space;0.1[/img]
Notice how the [i]absolute[/i] error stays the same as for [i]a[/i], at 0.000006103515625, the [i]relative[/i] error on the other hand, is now:
[img]http://latex.codecogs.com/gif.download?%5Cleft&space;|%5Cfrac{0.100006103515625-0.1}{0.1}&space;%5Cright&space;|&space;%5Capprox&space;0.0061&space;%5C%[/img]
This is over 1200 times as large as the relative error for [i]a[/i]. Therefore, all you've done, basically, is to massively downscale the precision. This is a known problem when subtracting relatively large floating point numbers with a relatively small difference.
[QUOTE=SupahVee;30603252]How do I prevent this?[/QUOTE]
Don't use floats; they suck ass.
[QUOTE=esalaka;30606222]The answer is that you need to check for equality with an epsilon (the smallest amount numbers can differ at a certain accuracy) and Krom's solution seems to explain that on StackOverflow.[/QUOTE]
I do not understand where I have to make that check. In the AABB intersection check?
[editline]21st June 2011[/editline]
[QUOTE=Anonim;30606358]Oh that's pretty easy to explain. ...[/QUOTE]
Amazing, I kind of understand the problem now. However SFML uses floats, so I need to use float in order to render things correctly.
If I wanted to hack around a bit, could using doubles solve this?
[QUOTE=SupahVee;30606391]If I wanted to hack around a bit, could using doubles solve this?[/QUOTE]
Maybe. It certainly adds a lot of precision, but it still has the same inaccuracies. Roughly, using an estimated calculation with WolframAlpha, I get 0.09999999999990905052982270717620849609375, which is a relative error of about 9.09e-11 %. So definitely an improvement.
There should've been hexadecatuple-precision floating points. That'd solve most precision issues. :saddowns:
Sorry, you need to Log In to post a reply to this thread.