Skip to main content
Commonmark migration
Source Link

#GolfScript, 49 bytes

GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]

#GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]

GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point.GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]

#GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]

#GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]
Source Link
Justin
  • 21.3k
  • 9
  • 67
  • 114

#GolfScript, 49 bytes

Note: this is a partial solution. I'm working on making it a complete solution

{{\.@\.[.,,\]zip@{[\~@-abs]}+%{~\;}$0=0==}%\;}:f;

Yes. GolfScript does support floating point. Try it out here. Example:

# B is [-20.1 2.2 10.3]
[-201 10 -1?*
22 10 -1?*
103 10 -1?*]

# A. No floating point numbers allowed here.
# This is because 1.5{}+ (where the 1.5 is a
# single floating point number, not 1.5,
# which would be 1 1 5) results in the block
# {1.5 }, which leads to 1 1 5 when executed
[1 5 9 -30]

Output:

[2.2 2.2 10.3 -20.1]