| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12
Comments:
<0> Run you could ask X <1> no <1> Would be an interesting question though, who should become the next manager if the current one disappeared (I keep forgetting who it is, which makes him a very good one imho) <2> Tech is manager <3> sigh <4> obviously, it would be me <1> I think I'd vote for _m_ if Tech disappeared - he's the most quiet one, yet a C++ guru ;) <4> tech hasn't disappeared though... are you planning something? ;) <1> lol <1> florida is going to be hit every year with hurricanes, more and more every year. <1> I wouldn't move there if I were you. <5> florida? <5> make that all over the world. <4> i already live here (FL) <0> yeah, wanna punish W for withdrawing from the Kyoto treaty <6> Florida is OK
<6> bette than NY at least :) <6> better even <1> disc: we got zero hurricanes in Europe... I don't think it will get very bad here any time soon due to the heat up <5> run, come again? <5> i live in norway. <5> and we -do- have hurricanes. <1> Maybe I don't watch tv enough. <6> bai <1> The only disasters I saw on tv were from over-seas <7> hm there were one over here in sweden.. <7> a year ago.. <7> that's about the only hurricane.. <8> we had one last year <8> ro <8> it was the first <7> sk8ing: where are you at? <8> romania <7> ah ok <9> people, I am seeking your advice about something. I have a PropertyDomainInteger that is a property (key, value pair ) identified as type INTEGER and that has a Minimum and Maximum range, for validation. The problem is that this propert represents anything that is integral, signed, unsigned, etc... <9> Now this object has also a validate() method that validates the property value against the domain. My problem is that the MinRaneg and MaxRange are int. meaning that they take only half of the range of an unsigned int. <9> I also have bool m_isMinRangeDefined and bool m_isMaxRangeDefinedbecause obviously I cannot use any value as an "undefined" one <7> mozai: what's the problem with that? <10> what do i have to do to change the text in a static text field from initialization in the dialog procedure? such as IDC_STATIC <0> rdragon "Florida: dontcha love it?" http://www.wftv.com/news/7359552/detail.html <7> mozai: if you are going to go negative, with the minimum you need to have it signed.. <9> aninimasu:Lets say property is "67", and maxRange is 4294967296,Since I use signed ints for maxRange it will be truncated <9> so basically I am screwed :-/ <7> mozai: explain why you are screwed, you can always use a type that can take a larger range. <11> PropertyDomainInteger<unsigned int> // i.e make it templated on the integral type <11> or make different Properties for signed and unsigned ints, whatever <9> C++ :) <0> type INTEGER ???? not in C++ <3> you want to say "Max range can be between a and b" by the definition of the type you chose <9> type INTEGER is my own internal type that defines a value of type int <3> then you want to set it to a value outside (a, b) and are wondering why that's a problem? <0> and how the **** are we supposed to know that? <7> ^_^ <9> "identified as type INTEGER " <9> or else i would have said "identified as an int" <7> that does not explain what a INTEGER is.. <7> hell, a integer could be 1e-50 <3> INTEGER is meaningless in terms of C++ <3> Anyway, the specific choice of type is irrelevent, the problem is purely logical <7> as it's a your custom type.. <9> ok, INTEGER is any intergral value <3> You've chosen a type with a range [a, b] to represent your minimum/maximum <3> Then want to set it to something outside [a, b] <3> That's obviously a problem. So choose a different type <9> yes, that is the problem <9> like what? <3> And if you're not sure up front what sort of types you want to use, template it <3> depends on your archiecture. "long long" will be enough, I'd imagine <11> mozai, just restrict INTEGER to be an int <0> or __int64 <11> or long, whatever <9> what if the integral value of the string is a long long <3> if you want more than +/- 2^63 - 1, then you're probably screwed for primitive types, but there are libraries for larger numbers
<3> this is a "non problem" anyway; you're validating that the value of X is between [a, b] <3> So pick the type of the validation interval to be the same as the range validation type <0> one presumes that you can actually represent a and b <3> And then it can never exceed that type and vice versa <9> but X can be outside [a,b] if [a,b] is signed <9> and if it is not signed, it cannot support negative ranges <3> Then we're back to my original statement; you've picked a range type that less precise than your validation type <9> unless I use two type, signe and unsined as two different objects <3> And that's always going to be a problem. Your range type will have to be at *least* as precise as your value type <11> just use ONE TYPE <3> and ideally, it will be the same type <3> if you need support for numbers bigger than +/- 2^63 -1, then you need to consider external APIs or other representations <3> s/numbers bigger/numeric ranges bigger <9> I think I am understanding you fully guys. Let's say my string is "4294967295" and I want to set my max range (int) to 4294967296. There would be now way of doing it. If i use an unsigned int as my max range, then I wouldnt be able to set it as a negatif max range <0> Asriel` 0 through 2^64-1 is avaialbe on many platforms as an intrinsic type <3> yes, but that has the same range as \pm 2^63 -1 <3> hence my "s/numbers bigger/number ranges..." <3> er <3> yes <0> mozai you can't <4> you can't represent 4294967296 with 32 bits <9> sure you can <0> NO YOU CANNOT <9> unsigned <4> you need 33 <3> exactly how can you represent that with 32 bits? <0> mozai sorry, it won't fit <9> 2^32 = 4294967296 <0> unsigned max is 4294967295 <4> just like you can't represent 4 with only 2 bits <4> same thing <9> ok, i gave a bad example <9> lets say max = 4294967295 <0> no **** <3> yes, but you've lose your zero there mozai - you can represent 4294967296 distinct numbers, not 4294967296 <9> Asriel: sorry, my mistake <4> mozai 2^32 can represent a range of 4294967296 numbers - when you include 0, the highest actual number you can represent is 4294967295 <9> yes, i understood that <4> ok <0> so what numbers DO you want as valid? <9> 4294967295 max value for an int as a maximum range <9> so I might use long long and restrict to that max range myself <4> can't do that either, max for int is 2-billion something <9> or else it is a catch 22 <3> This isn't really a hard problem, you're just looking for the trees rather than the wood <3> you can only *ever* validate up to the range of the representation of your type choice <3> that's is, end of story <3> er, that's *it*. I wish I could type <9> Asriel: I know, but I though that unsigned int is the largest Intergral value <12> lol <4> unsigned int goes up to 4294967295, yes <0> mozai yes, you keep saying thinks like I want to use 8 bit numbers but represent 256 as a good value <3> no, you can have a range of [0, 2^64 - 1] as a priumitive type <0> and on SOME machines unsigned int max is only 65535 <3> I'm also confused as to why you're using "string" to store your data and some numeric type to store your validation range <3> but that's a debate I'm hesitant to get into <0> Asriel` he needs fast validation, not fast math <9> vawjrwrk: dude, why your patronizing? I am not an expert like you guys...I am just asking for help as a beginner <3> ah <0> then perhaps you should pay attention to what we say and ask <9> vaw: I am paying attention, trust me. The problem is that I am not an native english speaker, so it take some time for me to understand what you're trying to say <0> you STILL haven't told us what RANGE of numbers you think you need to handle <9> ok, it would be the min range for a signed int and the max for an unsigned int <0> and, unfortunatly, C++ is abysmal at _defining_ what range of numbers is availalbe for each type <0> mozai that doesn't mean **** to me <9> hmmm <4> actual numbers, mozai <0> are you saying you need to hold std::numeric_limits(int)::min() through std::numeric_limits(unsigned int)::max() ? <0> oops <9> yes <0> are you saying you need to hold std::numeric_limits<int>::min() through std::numeric_limits<unsigned int>::max() ? <9> that is what I meant
Return to
#c++ or Go to some related
logs:
ANATOLIX BOOK
#php #linuxhelp roflseal
#AllNiteCafe #linuxhelp #linux #linuxhelp #linuxhelp muggsop
|
|