Beta
Line, Normalization
Loading description...
Mathematics
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Needs random tests
This would be pretty difficult for me to figure out. a) I haven't looked at this in a year. And b) it looks like something like this would just generally be difficult to do.
Anyone interested in giving it a shot is welcome to do so, though. It's definitely a good feature to add.
You didn't disable
Math.hypot
or evenMath.pow
. So what's the point in disablingMath.sqrt
ifMath.pow
can do the same thing effortlessly too?I've tweaked the sqrt blocking to also block
pow
andhypot
. Thanks!You're comparing the values by their exact value, which are suspectible to floating point errors.
Now uses
assertApproxEquals
.Needs sample tests
I've added a couple, though there's really too much going on in this kata to test much without just re-writing the entire "real" test suite.
It seems to have no description of method
.destroy
. It can be deduced frommaxPoolSize
andnew
, but still... Also description offrom
andto
parameters is slightly confusing, at least if you read the description from top to bottom. It says that they should be used to calculate rest of properties, but at this point no properties were mentioned yet. Just saying these are initial values for.from
and.to
should make it easier to understand.Good feedback! I've added a
.destroy()
explanation, and tried to clarify the.new(from, to)
explanation. Looking at it all this time later, it seems I've just ordered things strangely. ;/Thanks again for your help!
This comment has been hidden.
Your
Line.new()
can return an object. And the pool can just be some variable somewhere that is referenced byLine.new()
. Does that help?I think it does help, I was just not sure if I was supposed to use a JS feature that I was not aware of or not. So, if I understand correctly, the allocation pool is either a global variable or a local variable in an IIFE. Thanks!
No probs.